home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / progjour / 1988 / 01 / whetlin / time18i.asm < prev    next >
Assembly Source File  |  1986-11-22  |  804b  |  42 lines

  1. ;    Author:        M. Steven Baker
  2. ;    Date:        July 29, 1986
  3. ;
  4. ;    long time18(0)  -- returns timer counter in 18.2 counts/second    
  5. ;    long time18(long * loc)  -- also stores timer count in loc
  6. ;
  7. ; Version of Time() for Intel Fortran  to emulate UNIX time()
  8. ; returns timer interrupt count from BIOS data area
  9. ; count = 18.2 ticks per second
  10. ;    this version set up for Intel Fortran-86
  11. ;
  12.  
  13. DATA    segment at 40h
  14.     org    6ch
  15. timer_low    label    word
  16.     org    6eh
  17. timer_high    label    word
  18.     DATA    ends
  19.  
  20.  
  21. SUBPRG_CODE    SEGMENT
  22.  
  23. ;
  24.     public    TIME18
  25.     assume    cs:SUBPRG_CODE,ds:DATA
  26. ;
  27. TIME18    proc    far
  28.     push    ds        ;save DS
  29.     mov    ax,40h        ;point to ROM BIOS area
  30.     mov    ds,ax
  31.     cli            ;shut off interrupts
  32.     mov    ax,timer_low    ;timer_low
  33.     mov    dx,timer_high    ;timer_high
  34.     sti
  35.     pop    ds
  36.     ret
  37.  
  38. TIME18    endp
  39. SUBPRG_CODE    ends
  40.  
  41.     end
  42.